package com.example.orderservice_1.service;

import com.example.orderservice_1.domain.Settlement;
import com.example.orderservice_1.mapper.SettlementRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class SettlementService {

    @Autowired
    private SettlementRepository settlementRepository;

    // 创建结算
    public Settlement createSettlement(Settlement settlement) {
        settlement.setCreatedAt(new Date());
        settlement.setStatus("PENDING");
        return settlementRepository.save(settlement);
    }
}
